/*
 * Copyright 2007 phosphor Inc. All rights reserved.
 */

package com.maywide.jdp.core.utils;
import org.springframework.util.DigestUtils;

/**
 * 加密解密工具类
 * 
 * @author luoyang
 */
public class CryptoUtil {
	/**
	 * MD5加密明文
	 * 
	 * @param plainText
	 *            明文
	 * @return 密文
	 * @throws SysException
	 * @throws SysException
	 *             系统异常
	 */
	public static String md5(String plainText) throws Exception {
		String cipherText = null;
		byte[] plainBytes = plainText.getBytes();
		byte[] cipherByte = DigestUtils.md5Digest(plainBytes);
		cipherText = new String(cipherByte);
		return cipherText;
	}
}
